var jwt = require('jsonwebtoken');
let fs = require('fs')
let {projectRootPath} = require("../path/index")
let privateKey = fs.readFileSync(`${projectRootPath}/util/jwt/private.key`);
function signToken(object) {
    return jwt.sign(object, privateKey);
}
function verifyToken(token) {
    return jwt.verify(token, privateKey);
}
module.exports = {
    signToken,
    verifyToken
}